﻿//
// Created: 2018/12/2
// Author: chenqiang
//
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration;
using Model.WXshopBuiness;

namespace Model.WXshopBuiness.Map
{
    internal  class ProductSpecificationMap:EntityTypeConfiguration< ProductSpecification >    
    {
        public ProductSpecificationMap()
        {
             this.ToTable("ProductSpecification");
             this.HasKey(i => new { i.ProductSpecificationId });
             this.Property(i => i.ProductSpecificationId).HasColumnName("ProductSpecificationId");                     
             this.Property(i => i.ProductId).HasColumnName("ProductId");                     
             this.Property(i => i.SpecificationName).HasColumnName("SpecificationName");                     
             this.Property(i => i.SalesPrice).HasColumnName("SalesPrice");                     
             this.Property(i => i.OrignPrice).HasColumnName("OrignPrice");                     
             this.Property(i => i.Stock).HasColumnName("Stock");                     
             this.Property(i => i.CreateTime).HasColumnName("CreateTime");                     
             this.Property(i => i.Enable).HasColumnName("Enable");                     
             this.Property(i => i.Remarks).HasColumnName("Remarks");
            this.Property(i => i.CostPrice).HasColumnName("CostPrice");
            
        }   
    }
    
     public static class ProductSpecificationMapExtensions
    {
        public static void UserProductSpecificationMap(this DbModelBuilder pModelBuilder)
        {
            pModelBuilder.Configurations.Add(new ProductSpecificationMap());
        }
    }
}